#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py

class Test_father:
    def test_a(self):
        print('a')

    def test_b(self):
        print('b')

    def test_c(self):
        print('c')

    def index(self):
        print('index')


if __name__ == '__main__':
    father = Test_father()

    for attr in dir(father):#遍历father实例的所有属性和方法
        if attr.startswith('test_'):#判断是否是以test_前缀
            attrib = getattr(father, attr)
            if callable(attrib):#判断是否是函数
                attrib()






